<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>爱租网_个人中心</title>
	<link rel="icon" href="_img_/logo.ico"> 
	{css href="_js_/layui/css/layui.css"}
	{js href="_js_/jquery2.1.4.min.js"}
	{js href="_js_/layer/layer.js"}
	{js href="_js_/layui/layui.js"}
	{js href="_js_/jquery.validate.min.js"}
	{js href="_js_/jquery.form.js"}
	{js href="_js_/messages_zh.js"}
	<style>
		*{margin:0;padding:0;}
    .error{color:red;}
		.main{margin-left:170px;}
		.main>div{margin:10px 0;}
		.main>div>i{margin-right:5px;}
		.main>div>input{margin-left:25px;font-size:16px;color:#555555;padding:3px 5px;width:40%;}
    select{margin-left:13px;font-size:16px;color:#555555;padding:3px 5px;width:45%;}
    .btn{background:#ff3366;margin:10px 50px;}
	</style>
</head>
<body>
	{include file="public/myself_menu"}
  <form method="post" action="javascript:;">
  <div class="main">
  	<div>
  		<i class="layui-icon">&#xe612;</i>昵&nbsp;称：<input type="text" name="nickname" value="{$data.nickname}" required remote="{:url('index/vip/check1')}">
  	</div>
  	<div>
  		<i class="layui-icon">&#xe661;</i>性&nbsp;别：<input type="text" name="sex" value="{$data.sex}">
  	</div>
  	<div>
  		<i class="layui-icon">&#xe600;</i>星&nbsp;座：<input type="text" name="star" value="{$data.star}">
  	</div>
  	<div>
  		<i class="layui-icon">&#xe63b;</i>手&nbsp;机：<input type="text" name="tel" value="{$data.tel}" required remote="{:url('index/vip/check2')}">
  	</div>
  	<div>
  		<i class="layui-icon">&#xe62e;</i>所在区：<select name="area">
          <option value="">请选择区/县</option>
          {volist name="data_area" id="vo"}
          <option value="{$vo.id}" {if condition="$data.area==$vo.id"}selected{/if}>{$vo.name}</option>
          {/volist}
        </select>
  	</div>
  	<div>
  		<i class="layui-icon">&#xe631;</i>职&nbsp;业：<input type="text" name="job" value="{$data.job}">
  	</div>
  	<button type="submit" class="layui-btn btn">确认修改</button>
  </div>
  </form>
</body>
</html>
<script type="text/javascript">
  $().ready(function(){
    $('form').validate({
      rules:{

      },
      messages:{
        nickname:{
          required:'不能为空',
          remote:'已被注册'
        },
        tel:{
          required:'不能为空',
          remote:'已被注册'
        }
      },
      submitHandler:function(form){
        $(form).ajaxSubmit({
          type:'post',
          url:'{:url('index/vip/do_edit')}',
          datatype:'text',
          success:function(res){
            console.log(res.msg);
            if(res.msg == '成功'){
              layer.msg(res.msg,{icon:1,time:1000},function(){location.href='{:url('index/vip/myself')}'})
            }else{
              layer.msg(res.msg,{icon:3,time:1000})
            }
          }
        })
      }
    })
  });

	layui.use('element', function(){
		  var element = layui.element;
		});
</script>